import { IsNotEmpty, Allow } from 'class-validator'
import { IsExist } from 'src/custom-valid/isExist'

export class LoginDto {
   @IsNotEmpty({ message: '用户名不能为空' })
   @IsExist('user', { message: '用户名不存在' })
   username: string

   @IsNotEmpty({ message: '密码不能为空' })
   password: string

   @IsNotEmpty({ message: '验证码不能为空' })
   capthaValue: number

   @Allow()
   capthaKey: string
}
